package cate.game.role.res.farm.msg;

import cate.common.annotation.OperationSetter;
import cate.common.table.d.GDOperation;
import cate.common.util.GameResult;
import cate.game.GameBody;
import cate.game.client.ClientContext;
import cate.game.client.msg.ClientMsg;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgInput;
import cate.game.client.msg.id.MsgIdBFarms;
import easy.java.dev.note.NoteField;

@ClientMsg(title = "农场预设种子升级的请求")
@OperationSetter(value = GDOperation.FARM_PRE_SEED_LEVEL_UP, sub = "pos")
public class FarmsPreSeedLevelUpReq implements MsgInput {
    @NoteField("地块位置")
    public byte pos;
    @NoteField("种子类型")
    public byte seedType;

    @Override
    public void execute(GameBody game, ClientContext cc) {
        GameResult<Void> r = cc.getRole().getRes().farm.preSeedLevelUp(pos, seedType);
        game.notice.message(cc.getRole(), r, true);
    }

    @Override
    public MsgConfig conf() {
        return MsgIdBFarms.PRE_SEED_LEVEL_UP_REQ;
    }
}
